package net.borlis.sample.services.facade.ws.request;

import net.borlis.dictionaries.product.HierarchyLevelDictionary;

import javax.xml.bind.annotation.XmlElement;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author alex@borlis.net on 08.10.2014.
 */
public class PortfolioSettingUpdateRequest {

    private Long travelPeriodId;
    private Set<HierarchyLevelDictionary> hierarchyLevels;
    private Integer releaseDays;
    private List<TravelDurationRequest> travelDurations;
    private Double firstFixedMargin;
    private Double secondFixedMargin;
    private Double relativeMargin;
    private Boolean packaging;

    public PortfolioSettingUpdateRequest() {
    }

    public PortfolioSettingUpdateRequest(Long travelPeriodId, Set<HierarchyLevelDictionary> hierarchyLevels, Integer releaseDays,
                           List<TravelDurationRequest> travelDurations, Double firstFixedMargin, Double secondFixedMargin,
                           Double relativeMargin, Boolean packaging) {
        this.travelPeriodId = travelPeriodId;
        this.hierarchyLevels = hierarchyLevels;
        this.releaseDays = releaseDays;
        this.travelDurations = travelDurations;
        this.firstFixedMargin = firstFixedMargin;
        this.secondFixedMargin = secondFixedMargin;
        this.relativeMargin = relativeMargin;
        this.packaging = packaging;
    }

    @XmlElement
    public Boolean getPackaging() {
        return packaging;
    }

    public void setPackaging(Boolean packaging) {
        this.packaging = packaging;
    }

    @XmlElement
    public Double getFirstFixedMargin() {
        return firstFixedMargin;
    }

    public void setFirstFixedMargin(Double firstFixedMargin) {
        this.firstFixedMargin = firstFixedMargin;
    }

    @XmlElement
    public Double getSecondFixedMargin() {
        return secondFixedMargin;
    }

    public void setSecondFixedMargin(Double secondFixedMargin) {
        this.secondFixedMargin = secondFixedMargin;
    }

    @XmlElement
    public Double getRelativeMargin() {
        return relativeMargin;
    }

    public void setRelativeMargin(Double relativeMargin) {
        this.relativeMargin = relativeMargin;
    }

    @XmlElement
    public Long getTravelPeriodId() {
        return travelPeriodId;
    }

    public void setTravelPeriodId(Long travelPeriodId) {
        this.travelPeriodId = travelPeriodId;
    }

    @XmlElement
    public Set<HierarchyLevelDictionary> getHierarchyLevels() {
        return hierarchyLevels;
    }

    public void setHierarchyLevels(Set<HierarchyLevelDictionary> hierarchyLevels) {
        this.hierarchyLevels = hierarchyLevels;
    }

    @XmlElement
    public Integer getReleaseDays() {
        return releaseDays;
    }

    public void setReleaseDays(Integer releaseDays) {
        this.releaseDays = releaseDays;
    }

    @XmlElement
    public List<TravelDurationRequest> getTravelDurations() {
        if (travelDurations == null) {
            travelDurations = new ArrayList<>();
        }
        return travelDurations;
    }

    public void setTravelDurations(List<TravelDurationRequest> travelDurations) {
        this.travelDurations = travelDurations;
    }
}
